Ext.define('MyApp.view.user.PersonallyInfo', {
	extend : 'MyApp.view.ux.BaseWindow',
	alias : 'widget.personallyInfo',
	initComponent : function() {
		Ext.apply(this, {
					title:'个人信息',
					items : [{
								xtype: 'baseform',
								title:'基本信息',
								items:[{
									name: 'userName',
									emptyText : '输入用户名称,不能为空',
									fieldLabel: '用户名'
								},{
									name: 'loginID',
									validateOnChange:false,
									vtype:'alphanum',
									fieldLabel: '登陆ID',
									validator: function(value) {
										  var msg = true;
										  var record = this.up('form').getRecord();
										  if(!(record&&record.get('loginID')==value)){
										  	 Ext.Ajax.request({
											    url: 'user/chackUserLoginId',
											    params: {
											        loginId: value
											    },
											    async :  false,//同步请求数据
											    success: function(response){
											        var text = response.responseText;
											        if(text!=''){
											        	msg = false;
											        }
											    }
											});
										  }
										return msg?true:'登陆名已存在';
							        }
								}]
							},{
								xtype : 'uploadimageform',
								margin : 2,
								ownerEntity : 'UserEntity',
								title:'个人照片',
								ownerId : Ext.user.get('id')
							}]
				});
		this.callParent(arguments);
	}
});